package correct.day17;

import java.util.Scanner;

public class Test33 {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt(), k = in.nextInt();
        long[] a = new long[n + 1];
        long[] b = new long[n + 1];
        for(int i = 1; i <= n; i++)
            a[i] = in.nextLong();
        for(int i = 1; i <= n; i++)
            b[i] = in.nextLong();

        int left = 1, right = 1;
        long hSum = 0, sSum = 0, hMax = 0, sMin = 0, begin = 0;
        while(right <= n)
        {
            // 进窗⼝
            hSum += a[right]; sSum += b[right];

            // 出窗⼝
            while(right - left + 1 > k)
            {
                hSum -= a[left]; sSum -= b[left];
                left++;
            }

            // 更新结果
            if(right - left + 1 == k)
            {
                if(hSum > hMax)
                {
                    begin = left;
                    hMax = hSum;
                    sMin = sSum;
                }
                else if(hSum == hMax && sSum < sMin)
                {
                    begin = left;
                    sMin = sSum;
                }
            }

            right++;
        }

        System.out.println(begin);
    }
}
